#ifndef WEIGHT_H_
#define WEIGHT_H_

#include "indexer.h"
#include <math.h>

const int FACTOR = 10;

class Weight {
 public:
  
  Weight(int doc_num, int ave_len, float param_b = 0.25, float param_k1 = 1.2,
         float param_k2 = 100.0);
  ~Weight();
  
  float score_idf(const int df) const;
  
  float score_bm25(const int doc_id,
                   const int df,
                   const int tfq,
                   const int tfd,
                   const int doc_len) const;

 private:
  Weight();
  int doc_num_;
  float b_;
  float k1_;
  float k2_;

  float doc_ave_len_;

};

#endif
